{extend name="$BASE_POPUP_FORM" /}
{block name="body"}

<div class="box-content">

    <div class="control-row col-2">
        <div class="control-group">
            <label class="control-label">数量（台）</label>
            <div class="controls">
                <input type="number" id="amount" name="amount" class="form-control" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">选择用户</label>
            <div class="controls">
                <input id="user_id" name="user_id" data-ui="combosearch"
                       data-options="{valueField:'id',textField:'phone',showList:true,matchFields:['phone'],data:user_data,searchWin:openSearchWin}"
                       class="form-control"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">选择矿机</label>
            <div class="controls">
                <input id="e_id" name="e_id" data-ui="combosearch"
                       data-options="{valueField:'id',textField:'equip_name',showList:true,matchFields:['equip_name'],data:equip_data}"
                       class="form-control"/>
            </div>
        </div>
    </div>
</div>

{/block}

{block name="script"}
<script type="text/javascript">
  
    var user_data ={$user_list};
    function openSearchWin(){
        var url = getURL('member/select_user','','member');
        openBarWinParent('选择用户', 500, 600, url, function (data) {
            $("#user_id").setValue(data);
        }, ['选定', '取消']);
    }
    var equip_data ={$equip_list};
    function openSearchEquip(){
        var url = getURL('equip_order/select_equip','','equip');
        openBarWinParent('选择矿机', 500, 600, url, function (data) {
            $("#e_id").setValue(data);
        }, ['选定', '取消']);
    }
</script>
{/block}


